// Stream I/O Routines
//

#ifndef __FILE_SYS_H__
#define __FILE_SYS_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include "Types.h"

// Init file system
BOOL	fs_Initialize(void);

// Set the root directory
void    fs_SetRoot(const char *path);

// Get the root directory
const char*	fs_GetRoot(void);

// Get the full path of specified file as ROOT/filename
const char* fs_GetFullPath(const char *filename);

// aka fopen()
FILE*	fs_Open(const char* filename, char* mode);

// aka fclose()
// Note: should change this to fs_Close() later -OB
int		fs_Close_(FILE* stream);

// Note: should change this to fs_SafeClose() later -OB
void	fs_Close(FILE** stream);

// aka fread()
size_t	fs_Read(void* buffer, size_t size, FILE* stream);

// aka fwrite()
size_t	fs_Write(const void* buffer, size_t size, FILE* stream);

// aka fseek()
int		fs_Seek(FILE* stream, long offset, int orgin);

// aka ftell()
UInt32	fs_Tell(FILE* stream);

// Get file length in bytes
UInt32	fs_GetFileLen(FILE* stream);

// aka remove()
int		fs_Remove(const char* filename);

// aka fprintf()
int fs_Printf(FILE* stream,...);

#ifdef __cplusplus
}
#endif

#endif
